1. Field of the Invention
The invention relates to a method for processing noise interference, and more particularly to a method for processing noise interference according to an error feedback mechanism of an ATA/ATAPI (AT Attachment with Packet Interface).
2. Description of the Related Art
The serial ATA (Serial Advanced Technology Attachment, hereinafter referred to as SATA) is an interface specification commonly promoted by the companies of APT, Dell, IBM, Intel, Maxtor, Seagate, etc. The SATA specification is applied to the transmission interface of a hard disk drive or an optical disk drive to replace parallel ATA/ATAPI interface that has been used for a long time. The SATA interface specification specifies two pairs of differential signal lines to replace the original 40 or 80 signal lines connected in parallel. Serializing the original data can reduce the size and voltage and increase the speed. The specification also introduces some new functions, such as flow control and error resending, to control the data stream in a simple way.
FIG. 1 is a schematic illustration showing communication layers in the SATA specification. As shown in FIG. 1, the SATA interface connects a host 11 to a device 12. The device 12 may be an optical storage device or a hard disk drive, or other devices with the SATA interface. The communication layers in the SATA specification include four layers, which are respectively a first layer (physical layer), a second layer (link layer), a third layer (transport layer) and a fourth layer (application layer). The physical layer is responsible for converting digital and analog signals. That is, the physical layer receives and converts a digital signal sent from the link layer into an analog signal and sends the analog signal to the other end. The physical layer also receives and converts the analog signal, which comes from the other end, into a digital signal and outputs the digital signal to the link layer. The link layer encodes and decodes the digital data. That is, the link layer encodes the data coming from the transport layer and outputs the encoded data to the physical layer. On the other hand, the link layer decodes the data coming from the physical layer and outputs the decoded data to the transport layer. The transport layer constructs and deconstructs the FIS (Frame Information Structure). The detailed definition of the FIS can be found in the SATA specification. The application layer is in charge of buffer memory and DMA engine(s).
During the serializing process, the sending device converts the parallel data (e.g., data in bytes or words) into a serial bit data stream. In addition to the typical data, the SATA specification defines some data control codes with four bytes, which are referred to as primitives, for controlling the sending and power management of the sending device and the receiving device. For example, a X_RDY primitive (transmission data ready primitive) represents that the sending device is ready to send data, and a R_RDY primitive (receiver ready primitive) represents that the receiving device is ready to receive data.
FIG. 2 is a schematic illustration showing a packet sent through the SATA interface. Two devices communicate with each other to send the packet according to the X_RDY primitive (transmission data ready primitive) and the R_RDY primitive (receiver ready primitive). Then, the sending side sends a packet content, which is packed by a SOF primitive (start of frame) and an EOF primitive (End of frame). After the packet content is sent completely, the sending side sends a WTRM primitive (wait for frame termination primitive). If there is no any error about the CRC (Cyclic Redundancy Check) check in the link layer, the receiving side responds with a R_OK primitive (reception with no error primitive) after it receives the WTRM primitive. If there is an error about the CRC check, the receiving side responds with a R_ERR primitive (reception error).
The FIS is for transferring the task file register and data. Two examples will be described in the following. FIG. 3 is a schematic illustration showing a task file register FIS from a host to a device. That is, a task file register written from the host to the device is shown in FIG. 3. FIG. 4 is a schematic illustration showing a data FIS from the host to the device or from the device to the host. That is, the data sent from the host to the device or from the device to the host is shown in FIG. 4.
In order to prevent the error caused by noises, the SATA specification specifies a resending mechanism. Almost all type of FISs (e.g., Register-Host to Device FIS or Set Device Bits-Device to Host FIS) are resent when a R_ERR primitive was received so as to ensure that the receiving device can receive the correct control information. However, the data FIS does not have this protection mechanism. When the data error occurs, the device cannot be protected by the resending mechanism under the condition of noise interference because the data FIS is not resent. Thus, the error data may be received. In a more serious condition, some portions of primitives may be mistaken as data bits, thereby making the number of data sets to be sent to the device greater than it should be. In some cases, this error may halt the system.
In addition, in the device (e.g., an optical storage device) using the data FIS to send the ATA/ATAPI CDB (Command Descriptor Block), the CDB cannot be protected according to the resending mechanism because the data FIS is not resent. Thus, the device receives an abnormal control command, which causes a larger influence than in the case of sending the normal data using the data FIS.